package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.SelPictureActivity;
import flc.ast.databinding.FragmentToolBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link ToolFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class ToolFragment extends BaseNoModelFragment<FragmentToolBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.llFreeSplice.setOnClickListener(this);
        mDataBinding.llLongSplice.setOnClickListener(this);
        mDataBinding.ivPicMosaic.setOnClickListener(this);
        mDataBinding.ivPicOver.setOnClickListener(this);
        mDataBinding.ivPicWaterMark.setOnClickListener(this);
        mDataBinding.ivPicGrid.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.llFreeSplice://自由拼接
                SelPictureActivity.type = 5;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.llLongSplice://长图拼接
                SelPictureActivity.type = 6;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivPicMosaic://图片打码
                SelPictureActivity.type = 7;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivPicOver://图片叠加
                SelPictureActivity.type = 8;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivPicWaterMark://图片水印
                SelPictureActivity.type = 9;
                startActivity(SelPictureActivity.class);
                break;
            case R.id.ivPicGrid://九宫格
                SelPictureActivity.type = 10;
                startActivity(SelPictureActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}